CS262A Midterm Solutions
نویسنده
چکیده
[Yahel Ben-David:] I’ll presume the hardware used is the easier case of MIPS. The x86 architecture complicates things as some instructions may silently fail if not run under a real “ring-0” privileges. Before delving into the flow of control for handling a system-call (syscall) on a virtualized system, let’s briefly discuss what happens in a traditional setting (without virtualization): When the running application executes an instruction requiring access to restricted resources controlled by the OS it would make a syscall. In a syscall first the arguments will be pushed onto the stack and then a special trap/interrupt will be issued to transfer control to the kernel. The interrupt handler will transfer control to a well-defined location for the system call code (established during boot-time and thereafter is well known by the hardware as the target jump location for the interrupt). At the time of the interrupt the hardware also changes the processor mode to a protected kernel mode. Let’s list a simplified form of these steps and those that follow: 1. User-space process Executes instruction requiring privileged access. 2. User-space process – makes a system call which interrupts the OS. 3. Hardware/CPU – Switch to protected kernel mode and jump to syscall code. 4. OS running in protected kernel mode – execute the syscall code and return. 5. Hardware/CPU Switch to unprotected user mode and return to execute user code. 6. User-space process – resume execution of user code. On a virtualized platform the application does exactly the same thing as in steps 1 and 2, however since it’s the VMM that controls the machine, the interrupt handler implemented in the VMM will get executed. The VMM does not know how to handle the syscall (it can’t know that for every OS) but it does know the location for the OS’s interrupt handler code. It knows that because on boot-time, the OS tried to install its own interrupt handlers through use of privileged mode and hence got trapped by the VMM which then recorded all memory locations for interrupt handlers. Since the VMM is running in protected kernel mode, it now jumps to the OS’s interrupt handler and successfully executes that code as should have been done without virtualization. Midterm Histogram
منابع مشابه
Problem Set 3 Midterm Exam
Solutions must be submitted at beginning of class on Wednesday, March 3, 2004. This is an open-book exam. Handwritten answers are fine as long as they are legible and organized. Please show all work. I've tried to leave space on this handout for your solutions. The midterm is worth 15% of your total grade.
متن کاملImproving performance in quantum mechanics with explicit incentives to correct mistakes
An earlier investigation found that the performance of advanced students in a quantum mechanics course did not automatically improve from midterm to final exam on identical problems even when they were provided the correct solutions and their own graded exams. Here, we describe a study, which extended over four years, in which upper-level undergraduate students in a quantum physics course were ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2009